<div class="branches dropdown">
  <a href="javascript:void" data-toggle="dropdown" class="dropdown-toggle">
    <span class="branch">
      <span class="branch">{%if is_branch%}分支:{%elif is_tag%}标签:{%elif is_commit%}提交:{%endif%}</span>
      <span class="branch-name" title="{{refs}}">{{ refs|truncatechars:'20' }}</span>
    </span>
    <span class="caret"><i class="icon-caret-down"></i></span>
  </a>
  <ul class="dropdown-menu nav nav-list">
    {% if refs_meta.branches %}
    {% for branch in refs_meta.branches %}
    <li{%if branch == refs %} class="active"{%endif%}>
      <a href="/{{user_name}}/{{repo_name}}/{%if current == 'index' or current == 'tree' or current == 'blob' %}tree{%endif%}{%if current == 'commits' %}commits{%endif%}{%if current == 'refs_graph' %}refs/graph{%endif%}/{{branch}}/">{%if branch == refs %}<i class="icon-ok"></i>{%endif%}<span>{{branch}}</span></a>
    </li>
    {% endfor %}
    {% else %}
    <div class="inner"><div class="alert alert-info">没有分支</div></div>
    {% endif %}
    {% if refs_meta.tags|length > 0 %}
    <li class="divider"></li>
    {% endif %}
    {% for tag in refs_meta.tags %}
    <li{%if tag == refs %} class="active"{%endif%}>
      <a href="/{{user_name}}/{{repo_name}}/{%if current == 'index' or current == 'tree' or current == 'blob' %}tree{%endif%}{%if current == 'commits' %}commits{%endif%}{%if current == 'refs_graph' %}refs/graph{%endif%}/{{tag}}/">{%if tag == refs %}<i class="icon-ok"></i>{%endif%}<span>{{tag}}</span></a>
    </li>
    {% endfor %}
  </ul>
</div>
